<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]-->
    <script type="text/javascript" src="../../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../../lib/respond.min.js?rev=@@hash"></script>
    <!--[endif]-->
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../../../ht-css/Project.css" />
    <link rel="stylesheet" type="text/css" href="../../../../ht-css/style-q.css" />
    <!--[if IE 6]-->
    <script type="text/javascript" src="../../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <!--[endif]-->
    <title>安卓操作日志</title>
</head>
<body>
<nav class="breadcrumb">移动端管理 <span class="c-gray en">&gt;</span> <span onclick="returnVer()" style="cursor: pointer">ios版本号管理</span> <span class="c-gray en">&gt;</span> 操作日志<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px ;display:block" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="form-member"  method="post">
        <div class="bk-gray bg-1 pt-20 pb-20">
            <table class="table table-border table-bg table-hover table-sort mt-10" id="table">
                <thead >
                <tr class="text-c">
                    <th width="50">序号</th>
                    <th width="100">原值内容</th>
                    <th width="150">变更内容</th>
                    <th width="150">修改时间</th>
                    <th width="200">修改人</th>
                </tr>

                </thead>
                <tbody class="shun">
                </tbody>
            </table>
            <div class="dataTables_wrapper goods_fanye clearfix mt-5">
                <div class="f-r pageturning M-box3"></div>
            </div>
            <div class="mt-40"></div>
        </div>
    </form>

</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<script src="../../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../../ht-js/Project.js?rev=@@hash"></script>
<script src="../../../../ht-js/operation-js/operation_activity/activity_login.js?rev=@@hash"></script>
<!--引入分页-->
<link rel="stylesheet" href="../../../../lib/pagination/pagination.css">
<script src="../../../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<link type="text/css" rel="stylesheet" href="../../../../ht-js/operation-js/time-js/jedate.css">
<script type="text/javascript" src="../../../../ht-js/operation-js/time-js/jquery.jedate.js?rev=@@hash"></script>
<script>
    function returnVer(){
        $("body").load("ios_version.html");
    }


    $(function () {
        $.ajax({
                url: 'https://'+ window.location.host +'/api/admin/abaseservice/version/selectAppVersionLogByPage',
                cache: false, //禁用缓存
                type: "POST",
                dataType:"json",
                data:{"pageNum":1,"pageSize":5,"type":20},
                success: function(obj){
                    couponlist(obj.data, 0);
                    $('.M-box3').pagination({
                        pageCount: obj.data.totalPage,
                        jump: true,
                        coping: true,
                        prevContent: '上页',
                        nextContent: '下页',
                        callback: function (api) {
                            $.ajax({
                                url: 'https://'+ window.location.host +'/api/admin/abaseservice/version/selectAppVersionLogByPage',
                                cache: false, //禁用缓存
                                type: "POST",
                                dataType:"json",
                                data:{"pageNum":api.getCurrent(),"pageSize":5,"type":20},
                                success: function (obj) {
                                    couponlist(obj.data, 0);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    alert(XMLHttpRequest);
                                }
                            });
                        }
                    });
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert(XMLHttpRequest);
                }
            }
        )
    })

    var dataSource = new Array();
    //table的数据源
    var table;   //table对象
    dataSource = [];
    function couponlist(data, index){

        sessionStorage.setItem("authorizedUsers", JSON.stringify(data));
        dataSource.splice(0,dataSource.length);//清空数组


        if(data !=null && data != ''){
            console.log(data)
            var datashu =data.startIndex;

            $.each(data.result, function (i, field) {

                let versionContent = "";
                let  versiontent=""
                $.each(field,function(k,v){
                    console.log(v)
                    if (null != v[1].appVersionContentList && v[1].appVersionContentList.length>0) {
                        $.each(v[1].appVersionContentList,function (iii,vvv) {
                            versionContent += "<span>"+vvv.content+"</span><br>"
                        })
                    }//获取原值内容
                    if (null != v[0].appVersionContentList && v[0].appVersionContentList.length>0) {
                        $.each(v[0].appVersionContentList,function (iii,vvv) {
                            versiontent += "<span>"+vvv.content+"</span><br>"
                        })
                    }//获取变更内容

                    var datashus = datashu++
                    var rowData = new Array();
                    rowData.push(datashu);
                    rowData.push(v[1].versionCode);
                    rowData.push(v[1].updateType);
                    rowData.push(v[1].isOn);
                    rowData.push(versionContent);//原值内容

                    rowData.push(v[0].versionCode);
                    rowData.push(v[0].updateType);
                    rowData.push(v[0].isOn);
                    rowData.push(versiontent);//变更内容

                    rowData.push(v[0].updatedAt);
                    rowData.push(v[0].updateUser);
                    dataSource.push(rowData);
                })
            });
        }
        initDataTable(dataSource);

        function initDataTable(dataSource) {

            var dttable = $('#table').dataTable(); // 初始化dataTable，清空上一个值
            dttable.fnClearTable(); //清空一下table
            dttable.fnDestroy(); //还原初始化了的datatable
            $("#table").DataTable({
                // "order": false,
                "autoWidth": false,
                "ordering": false,
                "searching": false,
                "paging": false,
                "retrieve": true,
                "destroy": true,
                "bAutoWidth": true,
                "bLengthChange": true,
                "aLengthMenu": false,
                "oLanguage": {
                    "sLengthMenu": "每页显示 _MENU_ 条记录",
                    "sZeroRecords": "抱歉， 没有找到",
                    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                    "sInfoEmpty": "没有数据",
                    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "前一页",
                        "sNext": "后一页",
                        "sLast": "尾页"
                    },
                    "sZeroRecords": "没有检索到数据",
                },
                data: dataSource,
                columnDefs: [
                    {
                        "visible": true,
                        "targets": 0
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = row[0]
                            if (val == undefined) {
                                val = ''
                            }
                            return val;
                        },
                        "targets": 0
                    },

                    {
                        "render": function(data, type, row, meta) {
                            var updatupe=row[2]
                            var isOns=row[3]
                            if(row[2]==0){
                                updatupe='不升级'
                            }else if(row[2]==10){
                                updatupe='不强制更新'
                            }else if(row[2]==20){
                                updatupe='强制更新'
                            }

                            if(row[3]==10){
                                isOns='关闭'
                            }else if(row[3]==20){
                                isOns='开启'
                            }
                            /*var val = '<span>'+row[1]+'</span><br><span>'+updatupe+'</span><br><span>'+isOns+'</span><br><span>'+row[4]+'</span>';*/
                            var val = '<table border="2" style="border-color:#f5f5f5;"><tr><td>'+row[1]+'</td></tr><tr><td>'+updatupe+'</td></tr><tr><td>'+isOns+'</td></tr><tr><td>'+row[4]+'</td></tr></table>';

                            return val;
                        },
                        "targets": 1
                    },

                    {
                        "render": function(data, type, row, meta) {
                            var updatupes=row[6]
                            var isOnss=row[7]
                            if(row[6]==0){
                                updatupes='不升级'
                            }else if(row[6]==10){
                                updatupes='不强制更新'
                            }else if(row[6]==20){
                                updatupes='强制更新'
                            }

                            if(row[7]==10){
                                isOnss='关闭'
                            }else if(row[7]==20){
                                isOnss='开启'
                            }

                            var val = '<table border="2" style="border-color:#f5f5f5;"><tr><td >'+row[5]+'</td></tr><tr><td>'+updatupes+'</td></tr><tr><td>'+isOnss+'</td></tr><tr><td>'+row[8]+'</td></tr></table>';

                            return val;
                        },
                        "targets": 2
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = '';
                            var date = row[9];
                            var split = date.split(" ");
                            val = split[0] + '<br/>' + split[1];
                            return val;
                        },
                        "targets":3
                    },
                    {
                        "render": function (data, type, row, meta) {
                            var val = row[10]
                            if (val == undefined) {
                                val = ''
                            }
                            return val;
                        },
                        "targets": 4
                    },




                ]
            });

        };
    }
</script>
</body>
</html>